package com.youlemall.shop.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.youlemall.pojo.ItemCat;
import com.youlemall.service.ItemCatService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 2 * @Author: kevin
 * 3 * @Date: 2019/7/20 11:20
 * 4
 */

@RestController
@RequestMapping("/itemCat")
public class ItemCatController {

	@Reference
	private ItemCatService itemCatService;

	@GetMapping("/findItemCatByParentId")
	public List<ItemCat> findItemCatByParentId(Long parentId){
		try {
			return 	itemCatService.findItemCatByParentId(parentId);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}
